import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/double_control/get_tb_base_risk_events_by_id_entity.dart';

GetTbBaseRiskEventsByIdEntity $GetTbBaseRiskEventsByIdEntityFromJson(Map<String, dynamic> json) {
  final GetTbBaseRiskEventsByIdEntity getTbBaseRiskEventsByIdEntity = GetTbBaseRiskEventsByIdEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    getTbBaseRiskEventsByIdEntity.id = id;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    getTbBaseRiskEventsByIdEntity.companyCode = companyCode;
  }
  final String? riskUnitId = jsonConvert.convert<String>(json['riskUnitId']);
  if (riskUnitId != null) {
    getTbBaseRiskEventsByIdEntity.riskUnitId = riskUnitId;
  }
  final String? riskEventName = jsonConvert.convert<String>(json['riskEventName']);
  if (riskEventName != null) {
    getTbBaseRiskEventsByIdEntity.riskEventName = riskEventName;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    getTbBaseRiskEventsByIdEntity.deleted = deleted;
  }
  final int? initialRiskConsequences = jsonConvert.convert<int>(json['initialRiskConsequences']);
  if (initialRiskConsequences != null) {
    getTbBaseRiskEventsByIdEntity.initialRiskConsequences = initialRiskConsequences;
  }
  final int? initialRiskDegree = jsonConvert.convert<int>(json['initialRiskDegree']);
  if (initialRiskDegree != null) {
    getTbBaseRiskEventsByIdEntity.initialRiskDegree = initialRiskDegree;
  }
  final int? initialRiskPossibility = jsonConvert.convert<int>(json['initialRiskPossibility']);
  if (initialRiskPossibility != null) {
    getTbBaseRiskEventsByIdEntity.initialRiskPossibility = initialRiskPossibility;
  }
  final String? initialRiskLevel = jsonConvert.convert<String>(json['initialRiskLevel']);
  if (initialRiskLevel != null) {
    getTbBaseRiskEventsByIdEntity.initialRiskLevel = initialRiskLevel;
  }
  final String? currentRiskLevel = jsonConvert.convert<String>(json['currentRiskLevel']);
  if (currentRiskLevel != null) {
    getTbBaseRiskEventsByIdEntity.currentRiskLevel = currentRiskLevel;
  }
  final String? dataSources = jsonConvert.convert<String>(json['dataSources']);
  if (dataSources != null) {
    getTbBaseRiskEventsByIdEntity.dataSources = dataSources;
  }
  final dynamic workType = json['workType'];
  if (workType != null) {
    getTbBaseRiskEventsByIdEntity.workType = workType;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    getTbBaseRiskEventsByIdEntity.createDate = createDate;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    getTbBaseRiskEventsByIdEntity.createById = createById;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    getTbBaseRiskEventsByIdEntity.updateById = updateById;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    getTbBaseRiskEventsByIdEntity.createBy = createBy;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    getTbBaseRiskEventsByIdEntity.updateDate = updateDate;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    getTbBaseRiskEventsByIdEntity.updateBy = updateBy;
  }
  final String? hazardCode = jsonConvert.convert<String>(json['hazardCode']);
  if (hazardCode != null) {
    getTbBaseRiskEventsByIdEntity.hazardCode = hazardCode;
  }
  final String? riskObjectId = jsonConvert.convert<String>(json['riskObjectId']);
  if (riskObjectId != null) {
    getTbBaseRiskEventsByIdEntity.riskObjectId = riskObjectId;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    getTbBaseRiskEventsByIdEntity.status = status;
  }
  final String? riskDescription = jsonConvert.convert<String>(json['riskDescription']);
  if (riskDescription != null) {
    getTbBaseRiskEventsByIdEntity.riskDescription = riskDescription;
  }
  final String? warehouseId = jsonConvert.convert<String>(json['warehouseId']);
  if (warehouseId != null) {
    getTbBaseRiskEventsByIdEntity.warehouseId = warehouseId;
  }
  final int? isUpload = jsonConvert.convert<int>(json['isUpload']);
  if (isUpload != null) {
    getTbBaseRiskEventsByIdEntity.isUpload = isUpload;
  }
  final dynamic currentRiskDegree = json['currentRiskDegree'];
  if (currentRiskDegree != null) {
    getTbBaseRiskEventsByIdEntity.currentRiskDegree = currentRiskDegree;
  }
  final dynamic level = json['level'];
  if (level != null) {
    getTbBaseRiskEventsByIdEntity.level = level;
  }
  return getTbBaseRiskEventsByIdEntity;
}

Map<String, dynamic> $GetTbBaseRiskEventsByIdEntityToJson(GetTbBaseRiskEventsByIdEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyCode'] = entity.companyCode;
  data['riskUnitId'] = entity.riskUnitId;
  data['riskEventName'] = entity.riskEventName;
  data['deleted'] = entity.deleted;
  data['initialRiskConsequences'] = entity.initialRiskConsequences;
  data['initialRiskDegree'] = entity.initialRiskDegree;
  data['initialRiskPossibility'] = entity.initialRiskPossibility;
  data['initialRiskLevel'] = entity.initialRiskLevel;
  data['currentRiskLevel'] = entity.currentRiskLevel;
  data['dataSources'] = entity.dataSources;
  data['workType'] = entity.workType;
  data['createDate'] = entity.createDate;
  data['createById'] = entity.createById;
  data['updateById'] = entity.updateById;
  data['createBy'] = entity.createBy;
  data['updateDate'] = entity.updateDate;
  data['updateBy'] = entity.updateBy;
  data['hazardCode'] = entity.hazardCode;
  data['riskObjectId'] = entity.riskObjectId;
  data['status'] = entity.status;
  data['riskDescription'] = entity.riskDescription;
  data['warehouseId'] = entity.warehouseId;
  data['isUpload'] = entity.isUpload;
  data['currentRiskDegree'] = entity.currentRiskDegree;
  data['level'] = entity.level;
  return data;
}

extension GetTbBaseRiskEventsByIdEntityExtension on GetTbBaseRiskEventsByIdEntity {
  GetTbBaseRiskEventsByIdEntity copyWith({
    String? id,
    String? companyCode,
    String? riskUnitId,
    String? riskEventName,
    String? deleted,
    int? initialRiskConsequences,
    int? initialRiskDegree,
    int? initialRiskPossibility,
    String? initialRiskLevel,
    String? currentRiskLevel,
    String? dataSources,
    dynamic workType,
    String? createDate,
    String? createById,
    String? updateById,
    String? createBy,
    String? updateDate,
    String? updateBy,
    String? hazardCode,
    String? riskObjectId,
    int? status,
    String? riskDescription,
    String? warehouseId,
    int? isUpload,
    dynamic currentRiskDegree,
    dynamic level,
  }) {
    return GetTbBaseRiskEventsByIdEntity()
      ..id = id ?? this.id
      ..companyCode = companyCode ?? this.companyCode
      ..riskUnitId = riskUnitId ?? this.riskUnitId
      ..riskEventName = riskEventName ?? this.riskEventName
      ..deleted = deleted ?? this.deleted
      ..initialRiskConsequences = initialRiskConsequences ?? this.initialRiskConsequences
      ..initialRiskDegree = initialRiskDegree ?? this.initialRiskDegree
      ..initialRiskPossibility = initialRiskPossibility ?? this.initialRiskPossibility
      ..initialRiskLevel = initialRiskLevel ?? this.initialRiskLevel
      ..currentRiskLevel = currentRiskLevel ?? this.currentRiskLevel
      ..dataSources = dataSources ?? this.dataSources
      ..workType = workType ?? this.workType
      ..createDate = createDate ?? this.createDate
      ..createById = createById ?? this.createById
      ..updateById = updateById ?? this.updateById
      ..createBy = createBy ?? this.createBy
      ..updateDate = updateDate ?? this.updateDate
      ..updateBy = updateBy ?? this.updateBy
      ..hazardCode = hazardCode ?? this.hazardCode
      ..riskObjectId = riskObjectId ?? this.riskObjectId
      ..status = status ?? this.status
      ..riskDescription = riskDescription ?? this.riskDescription
      ..warehouseId = warehouseId ?? this.warehouseId
      ..isUpload = isUpload ?? this.isUpload
      ..currentRiskDegree = currentRiskDegree ?? this.currentRiskDegree
      ..level = level ?? this.level;
  }
}
